package com.juzi.wopu.service.impl;

import java.util.List;
import java.util.Map;

import com.juzi.wopu.domain.CartPlace;
import com.juzi.wopu.service.ICartPlaceService;

public class CartPlaceServiceImpl extends BaseServiceImpl<CartPlace> implements ICartPlaceService{

	@Override
	public void getCartPlaceMap(Map<Long, CartPlace> map1, Map<String, CartPlace> map2) {
		List<CartPlace> list=BaseDao.getAll(CartPlace.class);
		if(list!=null && list.size()>0){
			if(map1!=null && map2==null){
				for(CartPlace c:list){
					map1.put(c.getiPlaceId(), c);
				}
			}
			else if(map1==null && map2!=null){
				for(CartPlace c:list){
					map2.put(c.getsName(), c);
				}
			}
			else if(map1!=null && map2!=null){
				for(CartPlace c:list){
					map1.put(c.getiPlaceId(), c);
					map2.put(c.getsName(), c);
				}
			}
		}
		
	}

	@Override
	public List<CartPlace> findByCompany(Long compay) {
		String hql="from CartPlace where iCompany="+compay;
		List<CartPlace> list=BaseDao.findByhql(hql);
		return list;
	}
	
}
